package com.ssm.student.controller;

import com.ssm.student.model.Power;
import com.ssm.student.service.impl.PowerServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

public class PowerController {

       // int   insertPowertable(Power power);
       /*对外提供数据接口*/
       @Api(tags="power")
       @RestController
       public class RoleController {

           @Autowired
           private PowerServiceImpl powerService;
           @ApiOperation(value = "权限添加方法")
           @RequestMapping(value = "/addPower",method = RequestMethod.GET)
           public int AddPower(Power power){
               //传入数据的判断
               int IsAdd=0;
               //（1）权限实体不能为空
               if(power!=null){
                   //（2）权限名称不能为空
                   if(power.getPowerface()!=null){
                       //(3)添加权限数据
                       powerService.insertPower(power);
                   }
               }
               return IsAdd;    }

       }


}
